<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>遍历对象</title>
</head>

<body>
    <h1>遍历对象</h1>
    <hr />
</body>
<div id="demoReact"></div>
<script src="../../node_modules/babel-standalone/babel.min.js"></script>
<script src="../../node_modules/react/umd/react.development.js"></script>
<script src="../../node_modules/react-dom/umd/react-dom.development.js"></script>
<script type="text/babel">

    let object = {
        name: "奉先",
        age: 35,
        sex: "男"
    }


    function fun() {
        return (
            <div>
                {Object.keys(object).map(v => <p key={v}>{v} = {object[v]}</p>)}
            </div>
        )
    }

    let root = ReactDOM.createRoot(document.getElementById("demoReact"));
    root.render(fun());

</script>

</html>